﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading;
using System.Windows.Forms;
using PluginCommon;
using WinAPI.User32;

namespace KbdPlugIn
{
    public partial class MainUserControl : PluginFormBase
    {
        public MainUserControl()
        {
            InitializeComponent();
        }

        private void StartButton_Click(object sender, EventArgs e)
        {
            int count = Convert.ToInt32(CountTextBox.Text.Trim());
            while (count-- > 0)
            {
                User32Dll.keybd_event(0x55, User32Dll.MapVirtualKey(0x55, 0), 0 | 8, 0);
                User32Dll.keybd_event(0x55, User32Dll.MapVirtualKey(0x55, 0), 0x0002 | 8, 0);
                Thread.Sleep(100);
            }
        }
    }
}
